import { BasicColumn } from '/@/components/Table';
import { FormSchema } from '/@/components/Table';
import dayjs from 'dayjs';

export const columns: BasicColumn[] = [
  {
    title: '名称',
    dataIndex: 'name',
    width: 120,
  },
  {
    title: '未开始',
    dataIndex: 'countNot',
    width: 100,
  },
  {
    title: '处理中',
    dataIndex: 'countStarted',
    width: 100,
  },
  {
    title: '已结束',
    dataIndex: 'countFinished',
    width: 100,
  },
  {
    title: '已放弃',
    dataIndex: 'countDiscarded',
    width: 100,
  },
  {
    title: '合计',
    dataIndex: 'flowSum',
    width: 100,
  },
  {
    title: '每月平均',
    dataIndex: 'averageMonth',
    width: 100,
  },
  {
    title: '每日平均',
    dataIndex: 'averageDay',
    width: 100,
  },
];

const currentYear: any = dayjs().format('YYYY');
const end: number = currentYear - 0;
const begin: number = end - 12;
const years: Recordable[] = [];
for (let i = begin; i <= end; i++) {
  years.push({
    value: String(i),
    label: String(i),
  });
}

export const searchFormSchema: FormSchema[] = [
  {
    field: 'showYear',
    label: '年度',
    component: 'Select',
    colProps: { span: 4 },
    defaultValue: currentYear,
    componentProps: {
      showSearch: false,
      options: years,
    },
  },
  // {
  //   field: 'name',
  //   label: '名称',
  //   component: 'Input',
  //   colProps: { span: 8 },
  // },
];
